import request from '@/utils/request'
export function getData() {
  return request({
    url: '/couponlist'
  })
}
export function data(page) {
  return request({
    url: `/couponlist?_page=${page.page}&_limit=${page.pagesize}`
  })
}
export function gainData(id) {
  return request({
    url: `/couponlist/${id}`
  })
}
export function addData(data) {
  return request({
    url: '/couponlist',
    method: 'post',
    data
  })
}
export function delData(id) {
  return request({
    url: `/couponlist/${id}`,
    method: 'delete'
  })
}
export function upData(data) {
  return request({
    url: `/couponlist/${data.id}`,
    method: 'patch',
    data
  })
}
export function referData(data) {
  return request({
    url: `/couponlist?name_like=${data.name}&use_restrictions_like=${data.use_restrictions}`
  })
}
